﻿--
-- Dropping stored procedure pr_ChiTietPhieuXuat_SelectAll : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_ChiTietPhieuXuat_SelectAll]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_ChiTietPhieuXuat_SelectAll]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_ChiTietPhieuXuat_SelectAll
-- Author:	MinhNN
-- Create date:	5/14/2012 9:58:24 PM
-- Description:	This stored procedure is intended for selecting all rows from ChiTietPhieuXuat table
-- ==========================================================================================
Create Procedure pr_ChiTietPhieuXuat_SelectAll
As
Begin
	Select 
		[MaPhieuXuat],
		[MaHH],
		[SoLuong]
	From ChiTietPhieuXuat
End

GO


--
-- Dropping stored procedure pr_ChiTietPhieuXuat_SelectRow : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_ChiTietPhieuXuat_SelectRow]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_ChiTietPhieuXuat_SelectRow]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_ChiTietPhieuXuat_SelectRow
-- Author:	MinhNN
-- Create date:	5/14/2012 9:58:24 PM
-- Description:	This stored procedure is intended for selecting a specific row from ChiTietPhieuXuat table
-- ==========================================================================================
Create Procedure pr_ChiTietPhieuXuat_SelectRow
	@MaPhieuXuat varchar(10),
	@MaHH varchar(10)
As
Begin
	Select 
		[MaPhieuXuat],
		[MaHH],
		[SoLuong]
	From ChiTietPhieuXuat
	Where
		[MaPhieuXuat] = @MaPhieuXuat
		and [MaHH] = @MaHH
End

GO


--
-- Dropping stored procedure pr_ChiTietPhieuXuat_Insert : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_ChiTietPhieuXuat_Insert]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_ChiTietPhieuXuat_Insert]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_ChiTietPhieuXuat_Insert
-- Author:	MinhNN
-- Create date:	5/14/2012 9:58:24 PM
-- Description:	This stored procedure is intended for inserting values to ChiTietPhieuXuat table
-- ==========================================================================================
Create Procedure pr_ChiTietPhieuXuat_Insert
	@MaPhieuXuat varchar(10),
	@MaHH varchar(10),
	@SoLuong int
As
Begin
	Insert Into ChiTietPhieuXuat
		([MaPhieuXuat],[MaHH],[SoLuong])
	Values
		(@MaPhieuXuat,@MaHH,@SoLuong)

End

GO


--
-- Dropping stored procedure pr_ChiTietPhieuXuat_Update : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_ChiTietPhieuXuat_Update]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_ChiTietPhieuXuat_Update]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_ChiTietPhieuXuat_Update
-- Author:	MinhNN
-- Create date:	5/14/2012 9:58:24 PM
-- Description:	This stored procedure is intended for updating ChiTietPhieuXuat table
-- ==========================================================================================
Create Procedure pr_ChiTietPhieuXuat_Update
	@MaPhieuXuat varchar(10),
	@MaHH varchar(10),
	@SoLuong int
As
Begin
	Update ChiTietPhieuXuat
	Set
		[SoLuong] = @SoLuong
	Where		
		[MaPhieuXuat] = @MaPhieuXuat
		and [MaHH] = @MaHH

End

GO


--
-- Dropping stored procedure pr_ChiTietPhieuXuat_DeleteRow : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_ChiTietPhieuXuat_DeleteRow]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_ChiTietPhieuXuat_DeleteRow]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_ChiTietPhieuXuat_DeleteRow
-- Author:	MinhNN
-- Create date:	5/14/2012 9:58:24 PM
-- Description:	This stored procedure is intended for deleting a specific row from ChiTietPhieuXuat table
-- ==========================================================================================
Create Procedure pr_ChiTietPhieuXuat_DeleteRow
	@MaPhieuXuat varchar(10),
	@MaHH varchar(10)
As
Begin
	Delete ChiTietPhieuXuat
	Where
		[MaPhieuXuat] = @MaPhieuXuat
		and [MaHH] = @MaHH

End

GO
